package com.ht.medicaltreatment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.base.BaseUrl
import com.ht.medicaltreatment.bean.ListData
import com.ht.medicaltreatment.utils.loadImage

class ConsumableDetailAdapter : BaseQuickAdapter<ListData,BaseViewHolder>(R.layout.item_consumable_detail_layout) {
    override fun convert(holder: BaseViewHolder, item: ListData) {
        holder.loadImage(R.id.imgType,BaseUrl.baseUrl()+item.consumable.picturePath)
        holder.setText(R.id.tvName,item.consumable.name)
        holder.setText(R.id.tvTypeCode,"型号：${item.consumable.model}")
        holder.setText(R.id.tvSpecifications,"规格：${item.consumable.specification}")
        holder.setText(R.id.tvBrand,"品牌：${item.consumable.brand}")
        holder.setText(R.id.tvProgress,"已使用：${item.consumableUseProgress}")
    }
}
